package com.jc.business.userrole;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jc.business.base.BaseBusiness;
import com.jc.ds.model.UserRole;
import com.jc.service.userrole.UserRoleService;

@Service
public class UserRoleBusiness extends BaseBusiness {

	@Autowired
	UserRoleService userRoleService;
	
	
	/***
	 * 
	* @Title: getUserRoleListByUserId
	* @Description: 根据用户ID得到用户角色列表
	* @param @param userId
	* @param @return
	* @return Set<String>
	* @throws
	 */
	public Set<String> getUserRoleListByUserId(Long userId){
		Set<String> ret = new HashSet<String>();
		UserRole userRole = new UserRole();
		userRole.setUserId(userId);
		List<UserRole> _list = userRoleService.queryAll(userRole);
		for(UserRole ur : _list) {
			ret.add(ur.getRoleId().toString());
		}
		return ret;
	}
	
	
	
	
	
	
	

}
